from django.contrib import admin
from .models import ExtraReview

# Register your models here.

@admin.register(ExtraReview)
class ExtraReviewAdmin(admin.ModelAdmin):
    list_display = ['id', 'student', 'name', 'ranks', 'levels', 'grade', 'first_efficient', 'second_efficient', 'third_efficient', 'time']
    list_filter = ['first_efficient', 'second_efficient', 'third_efficient', 'time', 'sort', 'ranks']
    search_fields = ['student__username', 'name', 'classes', 'auditor']
    list_per_page = 20
    ordering = ['-created_at']
    readonly_fields = ['created_at', 'updated_at']
    
    fieldsets = [
        ('证书信息', {
            'fields': ['sort', 'name', 'ranks', 'levels', 'picture', 'grade']
        }),
        ('审核状态', {
            'fields': ['first_efficient', 'second_efficient', 'third_efficient']
        }),
        ('关联信息', {
            'fields': ['student', 'classes', 'time', 'auditor']
        }),
        ('元数据', {
            'fields': ['created_at', 'updated_at'],
            'classes': ['collapse']
        }),
    ]
